import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
import { Card, Row, Col, Button } from 'antd';
import { covertUrlParams } from 'utils';
import styles from './OperatorInfo.less';
import { CommonTable } from 'components';
import '../../config';
class OperatorInfo extends Component {

    operatorColumns = [
        { title: '号码', dataIndex: 'phoneNo', key: 'phoneNo' },
        { title: '号码标签', dataIndex: 'phoneTag', key: 'phoneTag' },
        { title: '归属地', dataIndex: 'area', key: 'area' },
        { title: '近6月主叫通话次数', dataIndex: 'callCountActive6month', key: 'callCountActive6month' },
        { title: '近6月被叫通话次数', dataIndex: 'callCountPassive6month', key: 'callCountPassive6month' },
        { title: '近3月通话次数(次)', dataIndex: 'callCount3month', key: 'callCount3month' },
        { title: '近3月通话时长(分)', dataIndex: 'callTime3month', key: 'callTime3month' },
        { title: '近6月通话次数', dataIndex: 'callCount6month', key: 'callCount6month' },
        { title: '近6月通话时长(分)', dataIndex: 'callTime6month', key: 'callTime6month' },
    ];

    constructor(props) {
        super(props);
        this.state = {};
        this.Contacts = [];
        this.Contacts = Constants.Contacts;
    }

    prevHandleClick = () => {
        const {  history, location: { pathname } } = this.props;
        history.push(`${pathname}?option=baseInfo`);
    }
    nextHandleClick =() => {
        const { history, location: { pathname } } = this.props;
        history.push(`${pathname}?option=checkResult`);
    }

    render() {
        return (
            <div>
                {/*<div className={styles.cardWrapper}>*/}
                {/*<Card type={'inner'} title={'基本信息'}>*/}
                {/*<Row gutter={24}>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>订单编号：</span><span>{message.name || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>用户ID：</span><span>{message.iphone || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>产品名称：</span><span>{message.registerTime || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>申请金额(元)：</span><span>{message.accountOption || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>申请时间：</span><span>{message.businessType || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>申请权限(天)：</span><span>{message.affiliationAddress || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>服务费：</span><span>{message.address || ''}</span></Col>*/}
                {/*</Row>*/}
                {/*</Card>*/}
                {/*</div>*/}

                {/*<div className={styles.cardWrapper}>*/}
                {/*<Card type={'inner'} title={'前10名手机联系人分析'}>*/}
                {/*<Row gutter={24}>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>订单编号：</span><span>{message.blackList || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>用户ID：</span><span>{message.applicationPlatform || ''}</span></Col>*/}
                {/*<Col className={styles.col} lg={12} xl={8}><span className={styles.title}>产品名称：</span><span>{message.creditScore || ''}</span></Col>*/}
                {/*</Row>*/}
                {/*</Card>*/}
                {/*</div>*/}
                <div className={styles.cardWrapper}>
                    <CommonTable
                        title={() => <div>top20通话记录</div>}
                        columns={this.operatorColumns}
                        pagination={null}
                        pageSize={20}
                        dataSource={this.Contacts}
                    />
                </div>
                {/*<div className={styles.cardWrapper}>*/}
                {/*<CommonTable title={() => <div>每月消费统计</div>} columns={this.consumptionColumns} dataSource={[]}/>*/}
                {/*</div>*/}

                <div className={`${styles.cardWrapper} ${styles.bottomBtn}`}>
                    <Button type={'primary'} onClick={this.prevHandleClick}>上一步</Button>
                    <Button type={'primary'} onClick={this.nextHandleClick}>下一步</Button>
                </div>
            </div>
        );
    }
}
OperatorInfo.propTypes = {
    message: PropTypes.object,
}
OperatorInfo.defaultProps = {
    message: {
        // name: '王XX',
        // iphone: '12345678936',
        // registerTime: '2015-5-12 12:20:12',
        // accountOption: 'ok',
        // businessType: '不知道',
        // affiliationAddress: '浙江省杭州市',
        // address: '浙江省杭州市',
        //
        // blackList: '000',
        // applicationPlatform: '220',
        // creditScore: '100',

        iphoneRecord: [],
        // consumption: [],

    }
}
export default withRouter(OperatorInfo);